enum Env {
  // 开发环境
  dev,

  // 测试环境
  test,

  // 生产环境
  pro,
}

class BaseConfig {
  // 应用名称
  static const String APPTITLE = "好看云";

  // Release 环境:true
  // Debug,Profile环境:false
  static bool _PROCESS = bool.fromEnvironment('dart.vm.product');

  // 基础请求，长连接路径
  static BaseUrl BASEURL = BaseUrl.fromJson(_PROCESS ? Env.pro : Env.dev);
}

class BaseUrl {
  Map<String, String> _REQUEST;
  Map<String, String> _WSS;
  Map<String, String> _IMG;

  BaseUrl.fromJson(Env process) {
    switch (process) {
      case Env.dev: // 开发环境
        _REQUEST = {
          "m1": 'http://xxxx',
          "m2": 'http://xxxx',
        };

        _IMG = {
          "m1": "http://xxxx/",
        };
        break;
      case Env.test: // 测试环境
        _REQUEST = {
          "m1": 'http://xxxx',
        };

        _IMG = {
          "m1": "http://xxxx/",
        };
        break;
      case Env.pro: // 生产环境
        _REQUEST = {
          "m1": 'http://xxxx',
        };

        _IMG = {
          "m1": "http://xxxx/",
        };
        break;
    }
  }

  Map<String, String> get WSS => _WSS;

  Map<String, String> get REQUEST => _REQUEST;

  Map<String, String> get IMG => _IMG;
}
